package unit4.part10;

public class HR extends Employer {// 继承

    public HR(String name, int level, int salary) {
        super(name, level, salary);
    }

    public void work() {// 重写
        super.work();
        System.out.println(this.getName() + " 积极组织员工活动！");
    }

    // HR可以根据职级为员工发放薪水
    public void paySalary(Employer em) {
        int level = em.getLevel();
        int realSalary = em.getSalary();
        if (level < 6) {
            realSalary = realSalary + 500;// 固定薪水 + 浮动薪水
        } else if (level < 10) {
            realSalary = realSalary + 800;
        } else if (level < 16) {
            realSalary = realSalary + 1000;
        }
        System.out.println("向员工 " + em.getName() + " 发放薪水 " + realSalary);
    }
}
